
var res = 1;
function loopGetLevel(obj, level) {
    var level = level ? level : 1;
    if (typeof obj === 'object') {
        for (var key in obj) {
            if (typeof obj[key] === 'object') {
                loopGetLevel(obj[key], level + 1);
            } else {
                res = level + 1 > res ? level + 1 : res;
            }
        }
    } else {
        res = level > res ? level : res;
    }
}